<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>报关单登记系统</title>
<style type="text/css">
  .base{
    padding:8px;
  }
  .baseCenter{
    left:50%;
    margin-left:-10.9cm;
    width:21.8cm;
    position:relative;
  }
  .baseBlock{
    left:50%;
    margin-left:-10.9cm;
    width:21.8cm;
    height:30cm;
    position:relative;
  }
</style>
<!--[if IE]>
<style type="text/css">
  .baseBlockIn{
    top:8px;
    left:8px;
  }
  .ieShadow{
    filter:progid:DXImageTransform.Microsoft.Blur(pixelradius=8);
    -ms-filter:"progid:DXImageTransform.Microsoft.Blur(pixelradius=8)";
    background-color:#000;
    position:relative;
  }
</style>
<![endif]-->
<!--#include file="lib/js-google-analytics.asp"-->
</head>
<body>
<div class="cdframe">
<%
if not CheckFlag(session("aaPostFlag"),2) then call JumpErrorPage(2)
id=saferequest("id",1)
rcd=saferequest("rcd",0)
set rs=Server.CreateObject("ADODB.Recordset")
sql="select cd,edoc_id from cdedoc where id="&id
if CheckWtr() then sql=sql&" and cd in (select id from cd where wtr="&session("iWtr")&")"
' response.write(sql)
rs.open sql,conn,1,1
if not rs.eof then
  if rcd<>"no" then call SimpleRecord("edocfile",id,"查看","成功",session("iId"),session("iClientId"),false)
  call ShowFile(rs("edoc_id"))
else
  if rcd<>"no" then call SimpleRecord("edocfile",id,"查看","失败",session("iId"),session("iClientId"),false)
  call JumpErrorPage(2)
end if
rs.close
set rs=nothing

function ShowFile(edoc_id)
  dim fs,edoc_file
  Set fs=Server.CreateObject("Scripting.FileSystemObject")
  edoc_file=Server.MapPath(".")&"\file\edoc\"&edoc_id
  ' Response.Write(edoc_file)
  If Not fs.FileExists(edoc_file) then 
    Response.Write("随附单据未保存在系统中")
  else
    Response.Write("<div class='base'><div class='baseBlock'><embed type='application/pdf' width='100%' height='100%' src='file/edoc/"&edoc_id&"#toolbar=0&navpanes=0&scrollbar=0"&"'></embed></div></div>")
  end if
  set fs=nothing
end function
%>
</div>
</body>
</html>
<!--#include file="lib/connclose.asp"-->

